package com.cn.qtms.controller;//类注释设置模板

import com.cn.qtms.base.controller.BaseController;
import com.cn.qtms.base.service.BaseService;
import com.cn.qtms.entity.TmSysUser;
import com.cn.qtms.service.TmSysUserService;
import com.cn.qtms.entity.vo.sys.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Name:TmSysUserController
 * @Description:
 * @Author: zhangyang
 * @Date: 2019-11-11 13:20
 **/
@RestController
@RequestMapping("user")
public class TmSysUserController extends BaseController<TmSysUser,Long> {
    @Autowired
    private TmSysUserService service;
    @Override
    protected BaseService<TmSysUser, Long> getService() {
        return service;
    }

    @GetMapping("findByUserName")
    public User findByUserName(@RequestParam("username") String username){
        return service.findByUserName(username);
    }

    @GetMapping("findByPhone")
    public User findByPhone(@RequestParam("phone") String phone){
        return service.findByPhone(phone);
    }
}
